gRPC(Remote Procedure call)
What is gRPC?
gRPC is a high performance, lightweight communication protocol , open-source universal RPC framework, developed by Google in 2015.The g in gRPC does not stand for Google. It was based on an internal Google project called Stubby which was an internal framework for gRPC,but just for Google services.It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication.It enables client and server applications to communicate transparently, and makes it easier to build connected systems. gRPC is a framework for implementing RPC APIs via HTTP/2 gRPC uses per-message size limits to manage incoming and outgoing messages. By default, gRPC limits incoming messages to 4 MB. There is no limit on outgoing messages.
When to use gRPC?
- Real-time communication services where you deal with streaming calls.
- When efficient communication is a goal.
- In multi-language environments.
- For internal APIs where you don't have to force technology choices on clients.
- New builds as part of transforming the existing RPC API might not be worth it.
Should I use gRPC instead of rest?
gRPC makes better use of HTTP/2 then REST. gRPC for example makes it possible to turn-off message compression. Compared to REST, gRPC provides greater performance at the expense of less flexibility. That is its main advantage over REST: gRPC, in most cases, is way faster and more robust, as it defines a specific set of rules each request and response should adhere to.This might be useful if you want to send an image that is already compressed.Compressing it again just takes up more time.Compared to REST, gRPC provides greater performance at the expense of less flexibility. ... That is its main advantage over REST: gRPC, in most cases, is way faster and more robust, as it defines a specific set of rules each request and response should adhere to.
What companies uses gRPC?
178 companies reportedly use gRPC in their tech stacks. These are some examples:-
- Netflix
- Cisco
- Slack.
- HENNGE K.K.
- medium.com.
- Alibaba Travels.
- Microsoft.
- 9GAG.
- Petal.
- Groww.
What languages support gRPC?
Out of the box, gRPC supports multiple programming languages : C#, Java, Go, Node. js, Python, PHP, Ruby ,Android Java, C#, C++, Dart, Go, Java, Kotlin/JVM, Objective-C, PHP, Python, Ruby and many more.
How do I know what version of gRPC I have?
If you build grpc.so from the souce, you can check the version of grpc inside package. xml file. If protoc hasn't been installed, you can download the protoc binary from the protocol buffers Github repository. Then unzip this file and update the environment variable PATH to include the path to the protoc binary file.